package com.designmodel.created.singleton;

/**
 * 懒汉式单例模式（适合多线程安全）
 *
 * @author think
 * @version 1.0.0
 */
public class Singleton5 {

    private static volatile Singleton5 singleton5 = null;

    private Singleton5() {
    }

    public static Singleton5 getInstance() {
        if (singleton5 == null) {
            synchronized (Singleton5.class) {
                if (singleton5 == null) {
                    singleton5 = new Singleton5();
                }
            }
        }
        return singleton5;
    }
}
